Conversation
| ## Coding Style | ||
|
|
||
| Use `PascalCase.res` for Reason implementation file names. | ||
| A ReScript interface file (`.resi`) should be included with every exercise to help the user get started. |
There was a problem hiding this comment.
We also need to provide the stub file. It'd probably be useful to showcase an example of one so it's clear that we don't want the completely empty stub that configlet create would gives us.
We should link to what an interface file is. We should highlight that this needs to be added manually since configlet create won't create an empty one for us.
| Use `PascalCase.res` for Reason implementation file names. | ||
| A ReScript interface file (`.resi`) should be included with every exercise to help the user get started. | ||
|
|
||
| Run `make format` on your code before pushing. |
There was a problem hiding this comment.
Should we make this a CI step? Format any new or updated code within a PR and error out if it doesn't match what was submited?
| - `config.json` - ensure that the new exercise data is correctly placed in order of difficulty and then alphabetically within that difficulty rating. | ||
| - implement exercise test cases, detailed in the [testing](#testing) section below. | ||
| - `exercises/practice/<exercise-slug>/.meta/<exercise-name>.res` - write an example of code here that will pass all test cases. This does not need to be the finest example of how to complete this exercise, but it must pass all the test cases. Update the interface file with the exposed function signatures in the `.resi` file. | ||
| - `exercises/practice/<exercise-slug>/wrc/<exercise-name>.res` - create an exercise stub here which returns `panic("'<function-name>' has not been implemented")`. Update the interface file with the function signatures, so that the student has a reference to what names and types are used. |
There was a problem hiding this comment.
| - `exercises/practice/<exercise-slug>/wrc/<exercise-name>.res` - create an exercise stub here which returns `panic("'<function-name>' has not been implemented")`. Update the interface file with the function signatures, so that the student has a reference to what names and types are used. | |
| - `exercises/practice/<exercise-slug>/src/<exercise-name>.res` - create an exercise stub here which returns `panic("'<function-name>' has not been implemented")`. Update the interface file with the function signatures, so that the student has a reference to what names and types are used. |
| Now complete the following steps: | ||
|
|
||
| - `config.json` - ensure that the new exercise data is correctly placed in order of difficulty and then alphabetically within that difficulty rating. | ||
| - implement exercise test cases, detailed in the [testing](#testing) section below. |
There was a problem hiding this comment.
We should be clear here that they need to make a template file first for the test generator to run. They then need to run the generator, making sure it runs a compilable ReScriptTest suite. Tests may need to be excluded from the tests.toml as well so that should be done as well. However, test generator may need to be rerun after you start working on the example solution and find a test for make sense for ReScript. Therefore we should mention or link out about the toml and how to skip a test there.
Most of that is in the below section but it should be inlined here or introduced beforehand.
Perhaps we break this into task-related sections:
Generating Tests?
Do this...
Updating An Existing Exercise?
Do this...
Adding A New Exercise?
Do this...
| - edit the `template` function so that it will generate the test cases. The `c` variable refers to a test case in `problem-specifications/exercises/<exercise-slug>/canonical-data.json`. Look at other exercise test templates for inspiration. | ||
|
|
||
| ### Using Docker | ||
| Run all exercise tests: |
There was a problem hiding this comment.
We should highlight first how to verify a single exercise and then all exercises in case someone just wants to verify the exercise being added passes.
|
|
||
| This command will iterate over all exercises and check to see if their example implementation passes all the tests. | ||
|
|
||
| To test that all exercises will pass in the CI/CD environment, run: |
There was a problem hiding this comment.
./bin/verify-exercises can be run locally too so it doesn't necessarily mean that if run locally it'll also pass the CI. I'd say something like to test that the example solution passes the test suite run ....
first draft of updating the repository's readme for contributing to the ReScript language track